package madixin.t409;

class Solution {
    public int longestPalindrome(String s) {
        int[] asc = new int[128];//ascii字符数组
        for (char c : s.toCharArray()) {
            asc[c]++;
        }

        int res = 0;

        for (int i = 0; i < 128; i++) {
            res += (asc[i]) / 2 * 2;
        }

        //奇数需要+1
        if (res < s.length()) {
            res++;
        }

        return res;
    }

    public static void main(String[] args) {
        System.out.println((int) 'a');
    }

}